﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EPioneerData.aspx.cs" Inherits="news_EPioneerData" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../css/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" defer="defer" src="../My97DatePicker/WdatePicker.js"></script>
    <script src="../js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../js/jquery.autocomplete.js" type="text/javascript" language="javascript"></script>
    <script src="../js/StockSearchData.js" language="javascript" type="text/javascript"></script>
    <script src="../js/jquery.query.url.js" type="text/javascript" language="javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var str = window.location.href;
            var pos = str.indexOf("?");
            var parastr = str.substring(pos + 1);
            $("#cbkAll").click(function () {
                var chks = $("input[tt=aa]");
                for (var i = 0; i < chks.length; i++) {
                    chks[i].checked = this.checked;
                }
            });
            $("#btnPub").click(function () {
                var chks = $("input[tt=aa]");
                var ids = "";
                for (var i = 0; i < chks.length; i++) {
                    if (chks[i].checked) {
                        ids += chks[i].value + ",";
                    }
                }
                ids = ids.substring(0, ids.length - 1);
                document.getElementById("hidIds").value = ids;
            });

            $("#btnCancelPub").click(function () {
                var chks = $("input[tt=aa]");
                document.getElementById("hidIds").value = "";
                var ids = "";
                for (var i = 0; i < chks.length; i++) {
                    if (chks[i].checked) {
                        ids += chks[i].value + ",";
                    }
                }
                ids = ids.substring(0, ids.length - 1);
                document.getElementById("hidIds").value = ids;
            });

            $("#btnCho").click(function () {
                var chks = $("input[tt=aa]");
                var ids = "";
                for (var i = 0; i < chks.length; i++) {
                    if (chks[i].checked) {
                        ids += chks[i].value + ",";
                    }
                }
                ids = ids.substring(0, ids.length - 1);
                document.getElementById("hidIds").value = ids;
            });

            $("#btnCancelCho").click(function () {
                var chks = $("input[tt=aa]");
                document.getElementById("hidIds").value = "";
                var ids = "";
                for (var i = 0; i < chks.length; i++) {
                    if (chks[i].checked) {
                        ids += chks[i].value + ",";
                    }
                }
                ids = ids.substring(0, ids.length - 1);
                document.getElementById("hidIds").value = ids;
            });

            $("#btnSelect").click(function () {
                var Title = $("#txtTitle").val()
                Title = encodeURI(Title);
                var date = $("#time").val();
                date = encodeURI(date);
                var edate = $("#etime").val();
                edate = encodeURI(edate);
                var newsTypeId = $("#ddlNewType1").val();
                newsTypeId = encodeURI(newsTypeId);
                var id = $("#txtId").val();

                var url = "EPioneerData.aspx?";

                var con = "";
                if (Title != "") {
                    if (con != "") {
                        con += "&title=" + Title;
                    }
                    else {
                        con = "title=" + Title;
                    }
                }
                if (edate != "") {
                    if (con != "") {
                        con += "&edate=" + edate;
                    } else {
                        con = "edate=" + edate;
                    }
                }
                if (date != "") {
                    if (con != "") {
                        con += "&date=" + date;
                    } else {
                        con = "date=" + date;
                    }
                }
                if (newsTypeId != "") {
                    if (con != "") {
                        con += "&newsTypeId=" + newsTypeId;
                    }
                    else {
                        con = "newsTypeId=" + newsTypeId;
                    }
                }
                if (id != "") {
                    if (id != "") {
                        con += "&id=" + id;
                    }
                    else {
                        con = "id=" + id;
                    }
                }
                document.location = url + con;
            });
        });

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <input type="button" id="btnSelect" value="查询" class="common_button" />
    <asp:Button ID="btnPub" runat="server" Text="发布" CssClass="common_button" OnClick="btnPub_Click" /><asp:Button
        ID="btnCancelPub" runat="server" Text="取消发布" CssClass="common_button" OnClick="btnCancelPub_Click"
        Width="70px" /><asp:Button ID="btnCho" runat="server" Text="精选" CssClass="common_button"
            OnClick="btnCho_Click" /><asp:Button ID="btnCancelCho" runat="server" Text="取消精选"
                CssClass="common_button" Width="70px" OnClick="btnCancelCho_Click" />
    <table class="query_form_table">
        <tr>
            <th>
                新闻类型
            </th>
            <td>
                <asp:DropDownList ID="ddlNewType1" runat="server">
                    <asp:ListItem Value="020103">财经新闻(内地财经)</asp:ListItem>
                    <asp:ListItem Value="56">异动板块</asp:ListItem>
                    <asp:ListItem Value="020107">新闻</asp:ListItem>
                    <asp:ListItem Value="54">股市直播</asp:ListItem>
                    <asp:ListItem Value="0">个股异动</asp:ListItem>
                    <asp:ListItem Value="0101">要闻</asp:ListItem>
                </asp:DropDownList>
            </td>
            <th>
                发布时间
            </th>
            <td>
                <input type="text" name="time" id="time" style="width: 80px;" onfocus="WdatePicker()" />
                至
                <input type="text" name="etime" id="etime" style="width: 80px;" onfocus="WdatePicker()" />
            </td>
        </tr>
        <tr>
            <th>
                编号
            </th>
            <td>
                <input type="text" id="txtId" />
            </td>
            <th>
                新闻标题
            </th>
            <td>
                <input type="text" id="txtTitle" />
            </td>
        </tr>
    </table>
    <div>
        <input id="hidIds" type="hidden" runat="server" />
        <table class="data_list_table">
            <tr>
                <th>
                    <input id="cbkAll" type="checkbox" />
                    全选
                </th>
                <th>
                    编号
                </th>
                <th>
                    标题
                </th>
                <th>
                    创建时间
                </th>
                <th>
                    发布时间
                </th>
                <th>
                    是否发布
                </th>
                <th>
                    是否精选
                </th>
                <th>
                    操作
                </th>
            </tr>
            <asp:Repeater ID="Repeater1" runat="server">
                <ItemTemplate>
                    <tr>
                        <td class="list_data_number">
                            <input name="select" value='<%# Eval("n_id") %>' type="checkbox" tt="aa" id="select"
                                runat="server" />
                        </td>
                        <td class="list_data_number" style="text-align:left;">
                            <%# Eval("n_id")%>
                        </td>
                        <td class="list_data_text" title='<%#Eval("n_content") %>' style="text-align:left;">
                            <%# Eval("n_title")%>
                        </td>
                        <td class="list_data_text">
                            <%# Eval("n_createdate", "{0:yyyy-MM-dd HH:mm:ss}")%>
                        </td>
                        <td class="list_data_text">
                            <%# Eval("n_modifyDate", "{0:yyyy-MM-dd HH:mm:ss}")%>
                        </td>
                        <td class="list_data_text">
                            <%# Eval("n_ISpublic")%>
                        </td>
                        <td class="list_data_text">
                            <%# Eval("n_Level")%>
                        </td>
                        <td class="list_data_ltext">
                            <a href='editEPioneerData.aspx?id=<%# Eval("n_id") %>&newsTypeId=<%=GetTypeId()%>'>
                                <img src="../images/bt_edit.gif" alt="修改标题" title="修改标题" /></a>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
            <tr style="display: none;">
                <th colspan="6" class="pager">
                    <div class="pager">
                        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" PageSize="15" UrlPaging="True"
                            OnPageChanged="AspNetPager1_PageChanged">
                        </webdiyer:AspNetPager>
                    </div>
                </th>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
